3.1.46 \(\int \frac {\tan ^3(c+d x)}{a+a \sin (c+d x)} \, dx\) [46]

Optimal. Leaf size=82 \[ -\frac {3 \tanh ^{-1}(\sin (c+d x))}{8 a d}+\frac {3 \sec (c+d x) \tan (c+d x)}{8 a d}-\frac {\sec (c+d x) \tan ^3(c+d x)}{4 a d}+\frac {\tan ^4(c+d x)}{4 a d} \]

[Out]

-3/8*arctanh(sin(d*x+c))/a/d+3/8*sec(d*x+c)*tan(d*x+c)/a/d-1/4*sec(d*x+c)*tan(d*x+c)^3/a/d+1/4*tan(d*x+c)^4/a/
d

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2785, 2687, 30, 2691, 3855} \begin {gather*} \frac {\tan ^4(c+d x)}{4 a d}-\frac {3 \tanh ^{-1}(\sin (c+d x))}{8 a d}-\frac {\tan ^3(c+d x) \sec (c+d x)}{4 a d}+\frac {3 \tan (c+d x) \sec (c+d x)}{8 a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^3/(a + a*Sin[c + d*x]),x]

[Out]

(-3*ArcTanh[Sin[c + d*x]])/(8*a*d) + (3*Sec[c + d*x]*Tan[c + d*x])/(8*a*d) - (Sec[c + d*x]*Tan[c + d*x]^3)/(4*
a*d) + Tan[c + d*x]^4/(4*a*d)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2687

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 2785

Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[1/a, Int[S
ec[e + f*x]^2*(g*Tan[e + f*x])^p, x], x] - Dist[1/(b*g), Int[Sec[e + f*x]*(g*Tan[e + f*x])^(p + 1), x], x] /;
FreeQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && NeQ[p, -1]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {\tan ^3(c+d x)}{a+a \sin (c+d x)} \, dx &=\frac {\int \sec ^2(c+d x) \tan ^3(c+d x) \, dx}{a}-\frac {\int \sec (c+d x) \tan ^4(c+d x) \, dx}{a}\\ &=-\frac {\sec (c+d x) \tan ^3(c+d x)}{4 a d}+\frac {3 \int \sec (c+d x) \tan ^2(c+d x) \, dx}{4 a}+\frac {\text {Subst}\left (\int x^3 \, dx,x,\tan (c+d x)\right )}{a d}\\ &=\frac {3 \sec (c+d x) \tan (c+d x)}{8 a d}-\frac {\sec (c+d x) \tan ^3(c+d x)}{4 a d}+\frac {\tan ^4(c+d x)}{4 a d}-\frac {3 \int \sec (c+d x) \, dx}{8 a}\\ &=-\frac {3 \tanh ^{-1}(\sin (c+d x))}{8 a d}+\frac {3 \sec (c+d x) \tan (c+d x)}{8 a d}-\frac {\sec (c+d x) \tan ^3(c+d x)}{4 a d}+\frac {\tan ^4(c+d x)}{4 a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.12, size = 54, normalized size = 0.66 \begin {gather*} -\frac {3 \tanh ^{-1}(\sin (c+d x))+\frac {1}{-1+\sin (c+d x)}-\frac {1}{(1+\sin (c+d x))^2}+\frac {4}{1+\sin (c+d x)}}{8 a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^3/(a + a*Sin[c + d*x]),x]

[Out]

-1/8*(3*ArcTanh[Sin[c + d*x]] + (-1 + Sin[c + d*x])^(-1) - (1 + Sin[c + d*x])^(-2) + 4/(1 + Sin[c + d*x]))/(a*
d)

________________________________________________________________________________________

Maple [A]
time = 0.21, size = 67, normalized size = 0.82

method result size
derivativedivides \(\frac {\frac {1}{8 \left (1+\sin \left (d x +c \right )\right )^{2}}-\frac {1}{2 \left (1+\sin \left (d x +c \right )\right )}-\frac {3 \ln \left (1+\sin \left (d x +c \right )\right )}{16}-\frac {1}{8 \left (\sin \left (d x +c \right )-1\right )}+\frac {3 \ln \left (\sin \left (d x +c \right )-1\right )}{16}}{d a}\) \(67\)
default \(\frac {\frac {1}{8 \left (1+\sin \left (d x +c \right )\right )^{2}}-\frac {1}{2 \left (1+\sin \left (d x +c \right )\right )}-\frac {3 \ln \left (1+\sin \left (d x +c \right )\right )}{16}-\frac {1}{8 \left (\sin \left (d x +c \right )-1\right )}+\frac {3 \ln \left (\sin \left (d x +c \right )-1\right )}{16}}{d a}\) \(67\)
risch \(-\frac {i \left (2 i {\mathrm e}^{4 i \left (d x +c \right )}-2 \,{\mathrm e}^{3 i \left (d x +c \right )}-2 i {\mathrm e}^{2 i \left (d x +c \right )}+5 \,{\mathrm e}^{5 i \left (d x +c \right )}+5 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{4 \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )^{4} \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )^{2} d a}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 a d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 a d}\) \(139\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^3/(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d/a*(1/8/(1+sin(d*x+c))^2-1/2/(1+sin(d*x+c))-3/16*ln(1+sin(d*x+c))-1/8/(sin(d*x+c)-1)+3/16*ln(sin(d*x+c)-1))

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 89, normalized size = 1.09 \begin {gather*} -\frac {\frac {2 \, {\left (5 \, \sin \left (d x + c\right )^{2} + \sin \left (d x + c\right ) - 2\right )}}{a \sin \left (d x + c\right )^{3} + a \sin \left (d x + c\right )^{2} - a \sin \left (d x + c\right ) - a} + \frac {3 \, \log \left (\sin \left (d x + c\right ) + 1\right )}{a} - \frac {3 \, \log \left (\sin \left (d x + c\right ) - 1\right )}{a}}{16 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

-1/16*(2*(5*sin(d*x + c)^2 + sin(d*x + c) - 2)/(a*sin(d*x + c)^3 + a*sin(d*x + c)^2 - a*sin(d*x + c) - a) + 3*
log(sin(d*x + c) + 1)/a - 3*log(sin(d*x + c) - 1)/a)/d

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 125, normalized size = 1.52 \begin {gather*} -\frac {10 \, \cos \left (d x + c\right )^{2} + 3 \, {\left (\cos \left (d x + c\right )^{2} \sin \left (d x + c\right ) + \cos \left (d x + c\right )^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (\cos \left (d x + c\right )^{2} \sin \left (d x + c\right ) + \cos \left (d x + c\right )^{2}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, \sin \left (d x + c\right ) - 6}{16 \, {\left (a d \cos \left (d x + c\right )^{2} \sin \left (d x + c\right ) + a d \cos \left (d x + c\right )^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/16*(10*cos(d*x + c)^2 + 3*(cos(d*x + c)^2*sin(d*x + c) + cos(d*x + c)^2)*log(sin(d*x + c) + 1) - 3*(cos(d*x
 + c)^2*sin(d*x + c) + cos(d*x + c)^2)*log(-sin(d*x + c) + 1) - 2*sin(d*x + c) - 6)/(a*d*cos(d*x + c)^2*sin(d*
x + c) + a*d*cos(d*x + c)^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\tan ^{3}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**3/(a+a*sin(d*x+c)),x)

[Out]

Integral(tan(c + d*x)**3/(sin(c + d*x) + 1), x)/a

________________________________________________________________________________________

Giac [A]
time = 5.72, size = 96, normalized size = 1.17 \begin {gather*} -\frac {\frac {6 \, \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{a} - \frac {6 \, \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{a} + \frac {2 \, {\left (3 \, \sin \left (d x + c\right ) - 1\right )}}{a {\left (\sin \left (d x + c\right ) - 1\right )}} - \frac {9 \, \sin \left (d x + c\right )^{2} + 2 \, \sin \left (d x + c\right ) - 3}{a {\left (\sin \left (d x + c\right ) + 1\right )}^{2}}}{32 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

-1/32*(6*log(abs(sin(d*x + c) + 1))/a - 6*log(abs(sin(d*x + c) - 1))/a + 2*(3*sin(d*x + c) - 1)/(a*(sin(d*x +
c) - 1)) - (9*sin(d*x + c)^2 + 2*sin(d*x + c) - 3)/(a*(sin(d*x + c) + 1)^2))/d

________________________________________________________________________________________

Mupad [B]
time = 9.11, size = 172, normalized size = 2.10 \begin {gather*} \frac {\frac {3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{4}+\frac {3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{2}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{2}+\frac {3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{2}+\frac {3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}-\frac {3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,a\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^3/(a + a*sin(c + d*x)),x)

[Out]

((3*tan(c/2 + (d*x)/2))/4 + (3*tan(c/2 + (d*x)/2)^2)/2 - tan(c/2 + (d*x)/2)^3/2 + (3*tan(c/2 + (d*x)/2)^4)/2 +
 (3*tan(c/2 + (d*x)/2)^5)/4)/(d*(a + 2*a*tan(c/2 + (d*x)/2) - a*tan(c/2 + (d*x)/2)^2 - 4*a*tan(c/2 + (d*x)/2)^
3 - a*tan(c/2 + (d*x)/2)^4 + 2*a*tan(c/2 + (d*x)/2)^5 + a*tan(c/2 + (d*x)/2)^6)) - (3*atanh(tan(c/2 + (d*x)/2)
))/(4*a*d)

________________________________________________________________________________________